package com.wits.media;

public class Yuv {

	public int y;
	public int u;
	public int v;
	
	public Yuv(int color) {
		int r = Rgb.red(color);
		int g = Rgb.green(color);
		int b = Rgb.blue(color);
		
        y = ( (  66 * r + 129 * g +  25 * b + 128) >> 8) +  16;
        u = ( ( -38 * r -  74 * g + 112 * b + 128) >> 8) + 128;
        v = ( ( 112 * r -  94 * g -  18 * b + 128) >> 8) + 128;
	}
	
	public Yuv(int y, int u, int v) {
		this.y = y;
		this.u = u;
		this.v = v;
	}
	
	
}
